//
//  CommonUtils.m
//  EValet
//
//  Created by admin on 15/6/16.
//  Copyright (c) 2015年 ice cream studios s.r.l. All rights reserved.
//

#import "CommonUtils.h"

@implementation CommonUtils

@end

@implementation UIColor (CommonUIExtensions)

+ (UIColor *)colorWithRGB:(NSInteger)rgb
{
    return [UIColor colorWithRed:((rgb & 0xFF0000) >> 16) / 255.0f
                           green:((rgb & 0xFF00) >> 8) / 255.0f
                            blue:((rgb & 0xFF)) / 255.0f
                           alpha:1.0f];

}

// 这个方法可以指定透明度，alpha取值是[0, 1.0]
+ (UIColor *)colorWithRGB:(NSInteger)rgb alpha:(CGFloat)alpha
{
    return [UIColor colorWithRed:((rgb & 0xFF0000) >> 16) / 255.0f
                           green:((rgb & 0xFF00) >> 8) / 255.0f
                            blue:((rgb & 0xFF)) / 255.0f
                           alpha:alpha];

}

@end